package com.woniuxy.yoga.order.client;

import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.feign.config.FeignConfig;
import com.woniuxy.yoga.order.model.dto.PrivateProductByIdDTO;
import com.woniuxy.yoga.order.model.dto.ProductByIdDTO;
import com.woniuxy.yoga.order.model.dto.TeamProductByIdDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@FeignClient(name = "product-service",configuration = FeignConfig.class,path = "/product")
public interface ProductClient {

    /**
     * 根据id查询普通产品信息
     * @param productId 产品id
     * @return 产品信息对象
     */
    @GetMapping("/product/getById/{productId}")
    Result<ProductByIdDTO> getByProductId(@PathVariable("productId") Integer productId);


    /**
     * 查询团课产品
     * @param teamProductId 团课产品id
     * @return TeamProductByIdDTO
     */
    @GetMapping("/teamProduct/getById/{teamProductId}")
    Result<TeamProductByIdDTO> getByTeamProductId(@PathVariable("teamProductId") Integer teamProductId);

    /**
     * id查询私教产品
     * @param privateProductId 私教课产品id
     * @return PrivateProductByIdDTO
     */
    @GetMapping("/privateProduct/getById/{privateProductId}")
    Result<PrivateProductByIdDTO> getByPrivateProductId(@PathVariable("privateProductId") Integer privateProductId);

    /**
     * 修改预约人数
     * @param teamProductId 团课产品id
     */
    @GetMapping("/teamProduct/modifyBookNum/{teamProductId}")
    Result<?> modifyBookNum(@PathVariable("teamProductId") Integer teamProductId);
}
